﻿using System;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.IEntity;

/// <summary>
///  审计聚合根
/// </summary>
public interface IAuditAggregateRoot : IAddGuidAggregateRoot, IModifyGuidAggregateRoot
{

}

/// <summary>
///  审计聚合跟
/// </summary>
public class AuditAggregateRoot : IAuditAggregateRoot
{
    /// <summary>
    ///  添加人
    /// </summary>
    [Column(Name = "add_user_id", CanUpdate = false, Position = -90)]
    public Guid? AddUserId { get; set; }

    /// <summary>
    ///  添加时间
    /// </summary>
    [Column(Name = "add_time", CanUpdate = false, Position = -89)]
    public DateTime AddTime { get; set; }

    /// <summary>
    ///   更新人
    /// </summary>
    [Column(Name = "modify_user_id", CanInsert = false, Position = -87)]
    public Guid? ModifyUserId { get; set; }

    /// <summary>
    ///  更新时间
    /// </summary>
    [Column(Name = "modify_time", CanInsert = false, Position = -86)]
    public DateTime? ModifyTime { get; set; }
}


/// <summary>
///  软删除审计聚合根
/// </summary>
public class AuditSoftDeleteAggregateRoot : AuditAggregateRoot, ISoftDelete
{
    /// <summary>
    ///  是否删除：0=未删除，1=已删除
    /// </summary>
    [Column(Name = "is_deleted", Position = -85)]
    public bool IsDeleted { get; set; }

    /// <summary>
    ///  删除时间
    /// </summary>
    [Column(Name = "deleted_time", Position = -84)]
    public DateTime? DeletedTime { get; set; }
}

/// <summary>
///  租户审计聚合根
/// </summary>
public class AuditTenantAggregateRoot : AuditAggregateRoot, ITenantGuid
{
    /// <summary>
    ///  租户id
    /// </summary>
    [Column(Name = "tenant_id", Position = -83)]
    public Guid? TenantId { get; set; }
}

/// <summary>
///  租户软删除聚合根
/// </summary>
public class AuditTenantSoftDeleteAggregateRoot : AuditTenantAggregateRoot, ISoftDelete
{
    /// <summary>
    ///  是否删除：0=未删除，1=已删除
    /// </summary>
    [Column(Name = "is_deleted", Position = -85)]
    public bool IsDeleted { get; set; }

    /// <summary>
    ///  删除时间
    /// </summary>
    [Column(Name = "deleted_time", Position = -84)]
    public DateTime? DeletedTime { get; set; }
}